package com.helper;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class ImageList extends BaseAdapter {
	
	 
	 private Bitmap[] maplist;
	 private Context mContext;
     public ImageList(Context c) {
         mContext = c;
     }

     public int getCount() {
         return maplist.length;
     }

     public Object getItem(int position) {
         return null;
     }

     public long getItemId(int position) {
         return 0;
     }

     public View getView(int position, View convertView, ViewGroup parent) {
         ImageView imageView;
         if (convertView == null) {  
             imageView = new ImageView(mContext);
             imageView.setLayoutParams(new GridView.LayoutParams(100, 100));
             imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
             imageView.setPadding(8, 8, 8, 8);
         } else {
             imageView = (ImageView) convertView;
         }

         imageView.setImageBitmap(maplist[position]);
         return imageView;
     }

	public Bitmap[] getMaplist() {
		return maplist;
	}

	public void setMaplist(Bitmap[] maplist) {
		this.maplist = maplist;
	}

}